package com.jinglvhuanjing.app.adapter;


import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.jinglvhuanjing.app.R;
import com.jinglvhuanjing.app.bean.SpoutSwitchBean;

import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;

public class SpoutSwitchAdapter extends BaseMultiItemQuickAdapter<SpoutSwitchBean, BaseViewHolder> {

    public SpoutSwitchAdapter(){
        addItemType(0 , R.layout.item_spout_switch_layout);
    }
    @Override
    protected void convert(BaseViewHolder baseViewHolder, SpoutSwitchBean spoutSwitchBean) {
        AppCompatTextView text = baseViewHolder.getView(R.id.text);
        AppCompatImageView switchImage  = baseViewHolder.getView(R.id.switch_img);
        text.setText(spoutSwitchBean.getName());
        switchImage.setSelected(spoutSwitchBean.isChecked());
    }
}
